package com.sgy.jar_package;

import com.sgy.utils.EPlatform;
import org.springframework.util.Assert;

/**
 * 信息
 * @author shenguangyang
 * @date 2022-06-27 21:59
 */
public class JarPackageInfo {
    /** 指定动态库是跑在哪个操作系统上 */
    private EPlatform platform;
    /** 指定动态库所在包下创建的PackageMark子类 */
    private Class<? extends PackageMark> packageMarkClass;
    /** 动态库所在模块打包之后的文件名, 比如 component-lib-hik-win64-1.0.0.jar */
    private String jarFileName;

    public void check() {
        Assert.notNull(platform, "platform is null");
        Assert.notNull(packageMarkClass, "packageMarkClass is null");
        Assert.notNull(jarFileName, "jarFileName is null or empty");
    }

    public JarPackageInfo(EPlatform platform, Class<? extends PackageMark> packageMarkClass, String jarFileName) {
        this.platform = platform;
        this.packageMarkClass = packageMarkClass;
        this.jarFileName = jarFileName;
    }

    public EPlatform getPlatform() {
        return platform;
    }

    public void setPlatform(EPlatform platform) {
        this.platform = platform;
    }

    public Class<? extends PackageMark> getPackageMarkClass() {
        return packageMarkClass;
    }

    public void setPackageMarkClass(Class<? extends PackageMark> packageMarkClass) {
        this.packageMarkClass = packageMarkClass;
    }

    public String getJarFileName() {
        return jarFileName;
    }

    public void setJarFileName(String jarFileName) {
        this.jarFileName = jarFileName;
    }
}
